From: Carlos Garnacho Date: Fri, 26 Jan 2024 19:22:14 +0000 (+0100) Subject: keyboard: Simplify group change emission at KeyboardController X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~281^2~1^2~76 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=c6d2f7d6c4442beaa3d743be2efbdcbd02409f81;p=gnome-shell.git keyboard: Simplify group change emission at KeyboardController Since we now just store the current group, we do not need to track closely source changes vs selection changes in the available sources. We just re-generate the current OSK keymap for all, so coalesce both signals into a more generic "group-changed". Part-of: --- diff --git a/js/ui/keyboard.js b/js/ui/keyboard.js index 423aeef23..c7f244b02 100644 --- a/js/ui/keyboard.js +++ b/js/ui/keyboard.js @@ -1335,8 +1335,7 @@ export const Keyboard = GObject.registerClass({ this._updateKeys(); this._keyboardController.connectObject( - 'active-group', this._onGroupChanged.bind(this), - 'groups-changed', this._onKeyboardGroupsChanged.bind(this), + 'group-changed', this._onGroupChanged.bind(this), 'panel-state', this._onKeyboardStateChanged.bind(this), 'purpose-changed', this._onPurposeChanged.bind(this), this); @@ -1755,10 +1754,6 @@ export const Keyboard = GObject.registerClass({ this._updateKeys(); } - _onKeyboardGroupsChanged() { - this._onGroupChanged(); - } - _onKeyboardStateChanged(controller, state) { let enabled; if (state === Clutter.InputPanelState.OFF) @@ -2101,13 +2096,13 @@ class KeyboardController extends Signals.EventEmitter { } _onSourcesModified() { - this.emit('groups-changed'); + this.emit('group-changed'); } _onSourceChanged(inputSourceManager, _oldSource) { let source = inputSourceManager.currentSource; this._currentSource = source; - this.emit('active-group', source.id); + this.emit('group-changed'); } _onContentPurposeHintsChanged(method) {